<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
		<title></title>
	</head>
	<body>
		
		<div id="example">
		  <p>Original message: "{{ message }}"</p>
		  <p>Computed reversed message: "{{ reversedMessage }}"</p>
		  <p>Time is {{now}}</p>
		</div>
		
		<script type="text/javascript">
			var vm = new Vue({
			  el: '#example',
			  data: {
			    message: 'Hello'
			  },
			  computed: {
			    // 计算属性的 getter
			    reversedMessage: function () {
			      // `this` 指向 vm 实例
			      return this.message.split('').reverse().join('')
			    },
				now:function(){
					return Date.now();
				}
			  }
			})
		</script>
		
	</body>
</html>
